<!DOCTYPE html>
<html lang="zh">
<head>
    <title>分类操作</title>
    <{include file="article/public/header"}>
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="/static/adminlte/plugins/icheck-bootstrap/icheck-bootstrap.min.css">

</head>
<body class="hold-transition sidebar-mini layout-fixed">

<!-- 内容区-->
<section class="content">
    <div class="container-fluid">
        <div class="row">
            <!-- left column -->
            <div class="col-md-12">
                <div class="card card-primary">
                    <div class="card-header">
                        <h3 class="card-title  ">分类操作<{$data?' -【'.$data.name.'】':''}></h3>
                    </div>

                    <form method="post" action="<{:url('category_action')}>" id="check-form">
                        <div class="card-body">

                            <div class="form-group">
                                <label for="fid">上级分类</label>
                                <select name="fid" id="fid" class="form-control">
                                    <option data-url="" value="0">顶级</option>
                                    <{if !empty($category)}>
                                    <{foreach $category as $one}>
                                    <option  <{if !empty($data['fid'])&&$data['fid']==$one.id}>selected<{/if}> value="<{$one.id}>"><{$one.name}></option>

                                    <{if !empty($one.subcat)}>
                                    <!-- <{foreach $one.subcat as $two}>
                                     <option disabled  <{if !empty($data['fid'])&&$data['fid']==$two.id}>selected<{/if}>   value ="<{$two.id}>" >|______<{$two.name}></option>
                                     <{/foreach}>-->
                                    <{/if}>

                                    <{/foreach}>
                                    <{/if}>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="title">分类名称</label>
                                <input name="title" value="<{$data?$data.name:''}>" type="text" class="form-control" id="title" placeholder="请输入名称">
                                <input type="hidden" name="id" value="<{$data?$data.id:'0'}>">
                            </div>



                            <div class="form-group" style="margin-top: 10px">

                                <div class="row">
                                    <div class="col-md-6 col-sm-6">
                                        <div class="form-group clearfix">
                                            <div class="icheck-primary d-inline">
                                                <{if !empty($data) && $data['status']=='0'}>
                                                <input type="checkbox" id="status" name="status" >
                                                <{else}>
                                                <input type="checkbox" id="status" name="status" checked>
                                                <{/if}>

                                                <label for="status">
                                                    启用
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="card-footer">
                                <button type="button" onclick="form_submit()" class="btn btn-primary">提交保存</button>
                                <a  target="_parent" href="<{:url('category')}>" class="btn btn-default bs-left-30">返回列表</a>
                            </div>
                        </div>
                    </form>
                </div>

            </div>

        </div>
    </div>
</section>

<{include file="article/public/footer"}>

</body>
</html>
